﻿using System;
using System.Collections.Generic;
using Microsoft.Popfly.GameCreator.Collections;

namespace Microsoft.Popfly.GameCreator.Data
{
    public class SceneInfo
    {
        [GameXamlProperty]
        public string Name { get; set; }

        [GameXamlProperty]
        public String Type;

        [GameXamlProperty]
        public double Width;

        [GameXamlProperty]
        public double Height;

        [GameXamlProperty]
        public string Appearance;

        [GameXamlProperty(objectType = typeof(MotionBehaviorInfo), nodeName = "Scene.Behaviors", dictionaryEntryNodeName = "Behavior", attributeName = "Type", attributeValue = "motion")]
        [GameXamlProperty(objectType = typeof(StateChangeBehaviorInfo), nodeName = "Scene.Behaviors", dictionaryEntryNodeName = "Behavior", attributeName = "Type", attributeValue = "stateChange")]
        [GameXamlProperty(objectType = typeof(PropertyChangeBehaviorInfo), nodeName = "Scene.Behaviors", dictionaryEntryNodeName = "PropertyChangeBehavior")]
        [GameXamlProperty(objectType = typeof(CustomBehaviorInfo), nodeName = "Scene.Behaviors", dictionaryEntryNodeName = "CustomBehavior")]
        [GameXamlProperty(objectType = typeof(SceneChangeBehaviorInfo), nodeName = "Scene.Behaviors", dictionaryEntryNodeName = "Behavior", attributeName = "Type", attributeValue = "sceneChange")]
        [GameXamlProperty(objectType = typeof(BulletBehaviorInfo), nodeName = "Scene.Behaviors", dictionaryEntryNodeName = "Behavior", attributeName = "Type", attributeValue = "bullet")]
        [GameXamlProperty(objectType = typeof(SoundBehaviorInfo), nodeName = "Scene.Behaviors", dictionaryEntryNodeName = "Behavior", attributeName = "Type", attributeValue = "sound")]
        [GameXamlProperty(objectType = typeof(AppearBehaviorInfo), nodeName = "Scene.Behaviors", dictionaryEntryNodeName = "Behavior", attributeName = "Type", attributeValue = "appear")]
        [GameXamlProperty(objectType = typeof(DisappearBehaviorInfo), nodeName = "Scene.Behaviors", dictionaryEntryNodeName = "Behavior", attributeName = "Type", attributeValue = "disappear")]
        public OrderedBehaviorStringtionary Behaviors;

        [GameXamlProperty(objectType = typeof(ActorInstanceInfo), nodeName = "Scene.ActorInstances", dictionaryEntryNodeName = "ActorInstance")]
        public OrderedDictionary<String, ActorInstanceInfo> ActorInstances;

        [GameXamlProperty(objectType = typeof(PropertyInfo), nodeName = "Scene.Properties", dictionaryEntryNodeName = "Property")]
        public Dictionary<String, PropertyInfo> properties;

        [GameXamlProperty]
        public bool UsingViewport;

        [GameXamlProperty]
        public double ViewportX;

        [GameXamlProperty]
        public double ViewportY;

        [GameXamlProperty]
        public double ViewportWidth;

        [GameXamlProperty]
        public double ViewportHeight;

        [GameXamlProperty(xamlMappingType = GameXamlProperty.XamlType.complex)]
        public BehaviorInfo.AudioInfo Audio;

        [GameXamlProperty(xamlMappingType = GameXamlProperty.XamlType.complex)]
        public BackgroundInfo Background;
    }
}
